<?php

class ActionController extends Zend_Controller_Action
{

  public function init()
  {

  }

  public function indexAction()
  {

  }

  public function createAction()
  {
    $this->view->form = $form = new Application_Form_Action_Create();
    $this->view->title  = 'Создание новостей';


    if ($this->getRequest()->isPost()) {
      if ($form->isValid($this->getRequest()->getPost())) {
        $action = new Application_Model_Action();
        $action->fill($this->getRequest()->getPost());
        $action->setPhoto($_FILES['image']);
        $action->save();
        $this->redirect('/');
      }
    }

  }

  public function editAction()
  {

  }

  public function deleteAction()
  {

  }

}

